package com.micro.modual.extension;

import com.micro.common.MicroConstant;
import com.micro.common.biz.GeneratorCodeUtil;
import com.micro.common.util.SnowFlakeUtil;
import com.micro.modual.entity.MessageSend;
import com.micro.modual.model.bo.messagesend.MessageSendBO;

/**
 * <h1>消息发送表 延展类</h1>
 *
 * @author LevelCoder
 * @version V1.0.0
 * @email LevelCoder@126.com
 * @date 2020-08-04 00:23:27
 */
public class MessageSendExtension {

    /**
     * <h2>转换: 消息发送表 新增</h2>
     *
     * @param messageSendBO {@link MessageSendBO} 消息发送表 新增/修改 请求对象
     * @return {@link MessageSend} 消息发送表
     */
    public static MessageSend converAddMessageSend(MessageSendBO messageSendBO) {
        MessageSend messageSend = new MessageSend();
        messageSend.setId(SnowFlakeUtil.getId());
        messageSend.setMessageTextId(messageSendBO.getMessageTextId());
        messageSend.setReceiverName(messageSendBO.getReceiverName());
        messageSend.setReceiverCode(messageSendBO.getReceiverCode());
        messageSend.setIsResd(messageSendBO.getIsResd());
        messageSend.setIsDeleted(messageSendBO.getIsDeleted());
        messageSend.setCreateTime(messageSendBO.getCreateTime());
        messageSend.setUpdateTime(messageSendBO.getUpdateTime());
        return messageSend;
    }

    /**
     * <h2>转换: 消息发送表 修改</h2>
     *
     * @param messageSendBO {@link MessageSendBO} 消息发送表 新增/修改 请求对象
     * @return {@link MessageSend} 消息发送表
     */
    public static MessageSend converEditMessageSend(MessageSendBO messageSendBO) {
        MessageSend messageSend = new MessageSend();
        messageSend.setId(messageSendBO.getId());
        messageSend.setMessageTextId(messageSendBO.getMessageTextId());
        messageSend.setReceiverName(messageSendBO.getReceiverName());
        messageSend.setReceiverCode(messageSendBO.getReceiverCode());
        messageSend.setIsResd(messageSendBO.getIsResd());
        messageSend.setIsDeleted(messageSendBO.getIsDeleted());
        messageSend.setCreateTime(messageSendBO.getCreateTime());
        messageSend.setUpdateTime(messageSendBO.getUpdateTime());
        return messageSend;
    }
}
